/*
 * @Description: 
 * @Autor: Ming
 * @LastEditors: Ming
 * @LastEditTime: 2021-11-18 13:46:06
 */
import { createRouter, createWebHashHistory } from 'vue-router'

const files = require.context('./modules', false, /\.js$/)
var pages = []
files.keys().forEach(key => {
  pages = pages.concat(files(key).default)
})

const routes = pages

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.beforeEach((to, from, next) => {
  document.title = to.meta.title || '乡村扶贫惠农推介系统'
  next()
})

export default router

